/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.insa.glaizot;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JComboBox;
import javax.swing.JOptionPane;

/**
 * MODIF
 * @author 4debefra
 */
public class ColonneCombo extends JComboBox {

    public ColonneCombo() {

    }

    public void afficheColonne(ResultSet col) {
        try {
            this.removeAllItems();
            while (col.next()) {
                String un = col.getString(1);
                this.addItem(un);
            }
        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(this, "Pb BdD : " + ex);
        }
    }
}
